//
//  ViewController.m
//  UI24-加密（MD5）
//
//  Created by 韩旭 on 16/8/16.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "ViewController.h"
#import "NSString+HX_MD5.h"
#import "NSString+HXSHA_1.h"
#import "NSString+HXBase64.h"
#import "NSString+HX_DES.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//    MD5 SHA-1 单向散列函数, 算法
//    1. MD5 验证算法
   NSString *string = @"123456778";
    NSString *finalString = [string stringWithhx_MD5_32Bitmd_5Lower];
    NSString *finalString1 = [string stringWithhx_MD5_32Bitmd_5Upper];
    NSLog(@"32BIT 小写 ：%@", finalString);
    NSLog(@"32BIT 大写 ：%@", finalString1);
 NSString *string16Md2 = [string stringWithhx_MD5_16Bitmd_5Lower];
    NSString *string16Md3 = [string stringWithhx_MD5_16Bitmd_5Upper];
    NSLog(@"16BIT 小写 ：%@", string16Md2);
    NSLog(@"16BIT 大写 ：%@", string16Md3);
    
    
    
//  2. SHA-1
    NSString *afterSha = @"hello";
    NSString *finalString_SHA1 = [afterSha stringWithSHA_1];
   NSLog(@"%@", finalString_SHA1);
    
    
//    3. Base 64
    NSString *after = @"hello";
   NSString *base64 = [after stringWithBase64];
    NSLog(@"base64 : %@", base64);
    NSString *finalStr64 = [base64 Base64WithString];
    NSLog(@"%@", finalStr64);
    
//    4. 对称密码
//    1. DES
//    2. 对称3重DES
//    3. AES
//
//    5.
    NSString *stringDES = @"123sdfdsfsd";
    NSString *strDES =[stringDES stringWithDES];
    NSLog(@"desString : %@", strDES);
    NSString *stringEDS = [strDES desWithString];
    NSLog(@"解密DES : %@", stringEDS);
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
